import com.sun.org.apache.xpath.internal.objects.XString;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class One {
    public static void main(String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        String t=br.readLine();
        boolean[] hash=new boolean[300];
        for (int i = 0; i < t.length(); i++) {
            hash[t.charAt(i)]=true;
        }
        for (int i = 0; i < s.length(); i++) {
            if (!hash[s.charAt(i)]){
                System.out.print(s.charAt(i));
            }
        }


    }
}
